package com.person.webdemoproject2.mapper;

import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

@Mapper
public interface DeleteMapper {
    @Select("select id from tb_post where id=#{postid} AND userid=#{userId}")
    Integer getPostId(Integer userId, Integer postid);
    @Select("select * from tb_post where id=#{commentId} AND userid=#{userId} ")
    Integer getCommentId(Integer userId, Integer commentId);
    @Select("select * from tb_user where id=#{userId}")
    String getPassword(Integer userId);
    @Delete("delete from tb_post where id=#{postId}")
    void deletePost(Integer postId);
    @Delete("delete from tb_comment where id=#{commentId}")
    void deleteComment(Integer commentId);
    @Delete("delete from tb_user where id=#{userId}")
    void deleteUser(Integer userId);
    @Select("select * from tb_collection where userid=#{userId} AND postid=#{postid}")
    Integer getCollect(Integer userId, Integer postid);
    @Select("delete from tb_collection where id=#{collectId}")
    void deleteCollection(Integer collectId);
}



